from rest_framework.views import APIView

from HomeAutoAI.common.Results import HttpResult
from HomeAutoAI.common.utils.ThreadLocal import get_cur_user
from llm.service.AssistantService import AssistantService


class AssistantGetAll(APIView):
    def get(self, request):
        try:
            user = get_cur_user()
            vo_list = AssistantService.get_all(user)
            return HttpResult.success(data=vo_list, message="成功获取")
        except Exception as e:
            return HttpResult.error(message=str(e))
